<?php
//type of request
//1: get description of product
//2: delete product
//3: edit price
if(isset($_REQUEST['cmd'])){
$cmd=$_REQUEST['cmd'];



function authenticateUser(){
	include("adb.php");
	$user_email=$_REQUEST['usermail'];
	$user_pass=$_REQUEST['userpass'];
	$obj=new adb();
	$sql_users="select * from users where email='$user_email'
	and password='$user_pass'";
		if($obj->query($sql_users)){
			$dataset=$obj->fetch();
			if(empty($dataset['email']) or empty($dataset['password'])){
			echo '{"result":2}';

			}
			else{
			echo '{"result":1}';
			
			}
		}
		
		
}
switch($cmd)
{
	case 1:
		authenticateUser();	
		break;
		
	default:
}
}
?>